package me.youline.dataServer.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

/**
 * 公告消息实体
 * @author linhan
 *
 */
@Entity
@Table(name = "yline_social_msg")
public class PublicMessage implements Serializable{
	
	

	private static final long serialVersionUID = -1313637287872784001L;
	
	/**
	 * 消息状态
	 * @author linhan
	 */
	public static enum MsgStatus{
		delete,//被删除
		privateMsg,//私密消息，仅自己可见
		publicMsg,//公开消息
	}
	
	
	@Id
	@GeneratedValue
	private Long id;
	
	@Column
	private String title;
	
	/**
	 * 消息创建人ID
	 */
	@Column
	private Long creatorId;
	

	/**
	 * 发布时间
	 */
	@Column
	@Temporal(TemporalType.TIMESTAMP)
	private Date publishTime;

	/**
	 * 消息点赞数记录实体
	 */
	@Transient
	private PubMsgStatisticRecorder messageRecorder;

	/**
	 * 识别图url
	 */
	@Column
	private String recognizePicUrl;
	
	
	/**
	 * 消息封面展示图URL
	 */
	@Column
	private String displayPicUrl;
	
	/**
	 * 消息所关联的内容ID
	 */
	@Column
	private Long arContentId;

	/**
	 * 场景ID
	 */
	@Column
	private Long sceneId;
	
	/**
	 *消息可见状态：自己可见，公开 
	 */
	@Column
	@Enumerated(EnumType.ORDINAL)
	private MsgStatus msgStatus;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Long getCreatorId() {
		return creatorId;
	}

	public void setCreatorId(Long creatorId) {
		this.creatorId = creatorId;
	}

	public Date getPublishTime() {
		return publishTime;
	}

	public void setPublishTime(Date publishTime) {
		this.publishTime = publishTime;
	}

	public PubMsgStatisticRecorder getMessageRecorder() {
		return messageRecorder;
	}

	public void setMessageRecorder(PubMsgStatisticRecorder messageRecorder) {
		this.messageRecorder = messageRecorder;
	}

	public String getRecognizePicUrl() {
		return recognizePicUrl;
	}

	public void setRecognizePicUrl(String recognizePicUrl) {
		this.recognizePicUrl = recognizePicUrl;
	}

	public String getDisplayPicUrl() {
		return displayPicUrl;
	}

	public void setDisplayPicUrl(String displayPicUrl) {
		this.displayPicUrl = displayPicUrl;
	}

	public Long getArContentId() {
		return arContentId;
	}

	public void setArContentId(Long arContentId) {
		this.arContentId = arContentId;
	}

	public Long getSceneId() {
		return sceneId;
	}

	public void setSceneId(Long sceneId) {
		this.sceneId = sceneId;
	}

	public MsgStatus getMsgStatus() {
		return msgStatus;
	}

	public void setMsgStatus(MsgStatus msgStatus) {
		this.msgStatus = msgStatus;
	}
	
}
